import Vue from "vue"
import App from "./App"
import store from "./store"
import tim from "./commen/tim/tim.js"
import commen from "./commen/commen.js"
import TIM from "tim-js-sdk"

Vue.prototype.tim = tim.tim;
Vue.prototype.$TIM = TIM;
Vue.prototype.$store = store;
Vue.prototype.$commen = commen;

import * as filters from "@/common/filters.js";

// 注入全局过滤器
Object.keys(filters).forEach(key => {
	Vue.filter(key, filters[key]);
});

// 引入uview
import uView from "uview-ui";
Vue.use(uView);

// 全局引入vuex
let vuexStore = require("@/store/$u.mixin.js");
Vue.mixin(vuexStore);

// 分享
import share from "@/utils/share.js";
Vue.mixin(share);

// 引入扩展方法
import "@/common/extend.js";

Vue.config.productionTip = false;  // 阻止 vue 在启动时生成生产提示

App.mpType = "app";

const app = new Vue({
	store,
	...App
});

// import httpRequest from "@/common/httpRequest"
// Vue.prototype.$httpRequest = httpRequest

// http拦截器，将此部分放在new Vue()和app.$mount()之间，才能App.vue中正常使用
import httpInterceptor from "@/common/http.interceptor.js";
Vue.use(httpInterceptor, app);

// http接口API集中管理引入部分
import httpApi from "@/common/http.api.js";
Vue.use(httpApi, app);

import tools from "@/common/tools.js";
Vue.use(tools, app);

app.$mount();
